//use mutable:"can never be const"
//const variable inside a function must be initialized while declaration
#include <iostream>
using namespace std;

class A {
  mutable int i;
public:
  void set_i(int ii) const;
  int get_i() const;
  A(){i = 12;}
};
void A::set_i(int ii) const //const can not be omitted, it specifies 'this'
{
  i = ii;//const_cast 'this' is not necessary
}

int A::get_i() const
{
  return i;
}

int main()
{
  A a;
  a.set_i(12);
  cout<<"a.i = "<<a.get_i()<<endl;

  const A const_a;//uninitialized const 'const_a' if no constructor
  const_a.set_i(1212);
  cout<<"const_a.i = "<<const_a.get_i()<<endl;
  return 0;
}
